/*
 * LotQtyDiscrepancyRecord.java
 *
 * Created on July 4, 2003, 10:56 AM
 */

package com.scalar.chiptrack.adaptor.jobs;

/**
 *
 * @author  Balaram Putta
 * @version 
 */

import com.scalar.chiptrack.utils.StringUtils;


public class LotQtyDiscrepancyRecord 
{
    private int    m_lotId           = -1;
    private String m_lotNumber       = null;
    private String m_partNumber      = null;
    private String m_processStepName = null;
    private String m_vendorName      = null;
    private int    m_oldQty          = 0;
    private String m_oldQtyDateIn    = null;
    private int    m_newQty          = 0;
    private String m_newQtyDateIn    = null;
    
    public LotQtyDiscrepancyRecord() { }

    public LotQtyDiscrepancyRecord( int lotId,
                                    String lotNumber,
                                    String partNumber,
                                    String processStepName,
                                    String vendorName,
                                    int oldQty,
                                    String oldQtyDateIn,
                                    int newQty,
                                    String newQtyDateIn )
    {
        
        m_lotId           = lotId;
        m_lotNumber       = lotNumber;
        m_partNumber      = partNumber;
        m_processStepName = processStepName;
        m_vendorName      = vendorName;
        m_oldQty          = oldQty;
        m_oldQtyDateIn    = oldQtyDateIn;
        m_newQty          = newQty;
        m_newQtyDateIn    = newQtyDateIn;
    }
    
    public int getLotId()
    {
        return m_lotId;
    }
    
    public String getLotNumber()
    {
        return m_lotNumber;
    }
    
    public String getLotNumberForHtmlView()
    {
        if( ( m_lotNumber == null ) || ( m_lotNumber.trim().length() == 0 ) )
        {
            return "&nbsp;";
        }
        
        return m_lotNumber;
    }
    
    public String getPartNumber()
    {
        return m_partNumber;
    }
    
    public String getPartNumberForHtmlView()
    {
        if( ( m_partNumber == null ) || ( m_partNumber.trim().length() == 0 ) )
        {
            return "&nbsp;";
        }
        
        return m_partNumber;
    }
    
    public String getProcessStepName()
    {
        return m_processStepName;
    }
    
    public String getProcessStepNameForHtmlView()
    {
        if( ( m_processStepName == null ) || ( m_processStepName.trim().length() == 0 ) )
        {
            return "&nbsp;";
        }

        return m_processStepName;
    }
    
    public String getVendorName()
    {
        return m_vendorName;
    }
    
    public String getVendorNameForHtmlView()
    {
        if( ( m_vendorName == null ) || ( m_vendorName.trim().length() == 0 ) )
        {
            return "&nbsp;";
        }

        return m_vendorName;
    }
    
    public int getOldQty()
    {
        return m_oldQty;
    }
    
    public String getOldQtyForHtmlView()
    {
        return StringUtils.formatUnits( m_oldQty );
    }
    
    public String getOldQtyDateIn()
    {
        return m_oldQtyDateIn;
    }
    
    public String getOldQtyDateInForHtmlView()
    {
        if( ( m_oldQtyDateIn == null ) || ( m_oldQtyDateIn.trim().length() == 0 ) )
        {
            return "&nbsp;";
        }

        return m_oldQtyDateIn;
    }
    
    public int getNewQty()
    {
        return m_newQty;
    }
    
    public String getNewQtyForHtmlView()
    {
        return StringUtils.formatUnits( m_newQty );
    }
    
    public String getNewQtyDateIn()
    {
        return m_newQtyDateIn;
    }
    
    public String getNewQtyDateInForHtmlView()
    {
        if( ( m_newQtyDateIn == null ) || ( m_newQtyDateIn.trim().length() == 0 ) )
        {
            return "&nbsp;";
        }

        return m_newQtyDateIn;
    }

    public String toString()
    {
        StringBuffer buf = new StringBuffer();
        buf.append( "[ Lot ID: " ).append( m_lotId );
        buf.append( "] [Lot#: " ).append( m_lotNumber );
        buf.append( "] [Part#: " ).append( m_partNumber );
        buf.append( "] [Process Step: " ).append( m_processStepName );
        buf.append( "] [Pre. QtyIn: " ).append( m_oldQty );
        buf.append( "] [Pre. DateIn: " ).append( m_oldQtyDateIn );
        buf.append( "] [QtyIn: " ).append( m_newQty );
        buf.append( "] [DateIn: " ).append( m_newQtyDateIn );
        buf.append( "] [Vendor: " ).append( m_vendorName ).append( "]" );
        
        return buf.toString();
    }

}